package com.dykj.fireFighting.server.socialUnit.devHis.mapper;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.dykj.fireFighting.api.socialUnit.devHis.dto.AlarmRecordDto;
import com.dykj.fireFighting.api.socialUnit.devHis.entity.AlarmRecord;
import com.dykj.fireFighting.api.socialUnit.devHis.entity.DevHis;
import com.dykj.fireFighting.api.socialUnit.devHis.vo.DevHisVo;
import com.dykj.fireFighting.common.core.mapper.SuperMapper;
import org.apache.ibatis.annotations.Param;

import java.util.Map;

/**
 * @Description 火灾自动报警设备运行记录
 * @Author hxb
 * @Date 2021-06-30 14:45:09
 */
public interface DevHisMapper extends SuperMapper<DevHis> {

    /**
     * @param page
     * @param params
     * @return
     */
    IPage<DevHis> queryList(Page page, @Param("params") Map<String, Object> params);

    /**
     * 报警信息分页
     *
     * @param page
     * @param alarmRecordDto
     * @return
     */
    IPage<AlarmRecord> queryAlarmList(Page<AlarmRecord> page, @Param("ew") AlarmRecordDto alarmRecordDto);

    IPage<DevHisVo> queryDevHisByRelationId(Page<DevHisVo> page, @Param("params") Map<String, String> params);

    int getFireNum(@Param("id") String id, @Param("start") String start, @Param("end") String end);

    int getFireGZNum(@Param("id") String id, @Param("start") String start, @Param("end") String end);


    int getWait(@Param("id") String s);

    int getFaultNotReadNum(String unitId);

    IPage<DevHisVo> getFaultList(Page<DevHisVo> page, @Param("params") Map<String, String> params);

    IPage<DevHisVo> getDevHisOther(Page<DevHisVo> page, @Param("unitId") String unitId);

    int updateFaultReadType(String unitId);

    DevHis getDevHisById(@Param("id") String id);

    void updateTableNameById(DevHis devHis, String tableName);

    /**
     * 获取设备信息
     *
     * @param relationId
     * @return
     */
    DevHis queryByRelationId(@Param("relationId") String relationId);

    int isExistTable(String tableName);
}
